Fix up rendering of non-double-buffered overlays
authorAlexander Larsson <alexl@redhat.com>
Thu, 1 Mar 2012 13:14:33 +0000 (14:14 +0100)
committerAlexander Larsson <alexl@redhat.com>
Thu, 1 Mar 2012 13:14:33 +0000 (14:14 +0100)
My previous fix for this broke the progress bar in epiphany. This fix
makes it work again, and keeps the gimp bug fixed.

Basically, whenever we do a non-double-buffered rendering we have to
flush the entire window as it might be drawn outside the double
buffering machinery.

gdk/gdkwindow.c

index cf8203ba150d18e2a95a169de5a7a3407f12f29b..0fc68fed2df655f2b16bf5a9995e3e124d0f6c0f 100644 (file)
@@ -2763,6 +2763,12 @@ gdk_window_flush_implicit_paint (GdkWindow *window)
   region = cairo_region_copy (window->clip_region_with_children);
 
   cairo_region_translate (region, window->abs_x, window->abs_y);
+
+  if (paint->flushed == NULL)
+    paint->flushed = cairo_region_copy (region);
+  else
+    cairo_region_union (paint->flushed, region);
+
   cairo_region_intersect (region, paint->region);
 
   /* Don't flush active double buffers, as that may show partially done
@@ -2789,11 +2795,9 @@ gdk_window_flush_implicit_paint (GdkWindow *window)
       cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE);
       cairo_paint (cr);
       cairo_destroy (cr);
-
-      paint->flushed = region;
     }
-  else
-    cairo_region_destroy (region);
+
+  cairo_region_destroy (region);
 }
 
 /* Ends an implicit paint, paired with gdk_window_begin_implicit_paint returning TRUE */
@@ -2984,9 +2988,9 @@ gdk_window_begin_paint_region (GdkWindow       *window,
       if (implicit_paint)
        {
          cairo_region_t *flushed = cairo_region_copy (implicit_paint->flushed);
-         cairo_region_intersect (flushed, region);
          /* Convert from impl coords */
          cairo_region_translate (flushed, -window->abs_x, -window->abs_y);
+         cairo_region_intersect (flushed, paint->region);
          gdk_cairo_region (cr, flushed);
          cairo_clip (cr);